jsaEvenPhasor (Function) Class
Item Index
Methods
(jsaEvenPhasor)
()
Creates a phasor used to periodically trigger events
Returns:
Interface object for controlling the eventPhasor containing all the other methods in this module.
advance
-
interval
Advance the time rotating the phasor accorording to its frequency.
Parameters:
-
interval
Numberof time to advance
Returns:
current phase
advanceToTick
()
Advances the time to that of next zero phase (which is when it "ticks")
advanceToTime
-
The
Set the time of the phasor rotating if from its current position as necessary
Parameters:
-
The
Numbertime to advance the phasor to.
Returns:
current phase
getPhase
-
phase
Get the current phse
Parameters:
-
phase
Numberin [0,1]
nextTickTime
()
Number
Advances the time to that of next zero phase (which is when it "ticks")
Returns:
time in sseconds
setCurrentTime
-
time
Sets the time
Parameters:
-
time
Number(in secs)
setFreq
()
Sets the frequency that the phase will move (revolutions per second)
setPhase
-
phase
Sets the phaser to a specific phase
Parameters:
-
phase
Numberin [0,1]
timeToTick
()
Number
Get the time between now and the next tick
Returns:
the amount of time until next tick